const gulp = require("gulp");

const uglify = require("gulp-uglify");
const css = require("gulp-clean-css");
const babel = require("gulp-babel");
gulp.task("copy", done => {

    gulp.src("images")
        .pipe(gulp.dest("dist"))

    done();
});
//压缩多个文件，并改名
gulp.task("uglify", done => {
    gulp.src("es5/*.js")
        .pipe(uglify())
        .pipe(gulp.dest("dist/js"));
    done();
});
//es6转换
gulp.task("babel", done => {
    gulp.src("js/*")
        .pipe(babel({
            presets: ['@babel/preset-env']
        }))
        .pipe(gulp.dest("es5"));
    done();
})
//压缩css
gulp.task("css", done => {
    gulp.src("css/css/*.css")
        .pipe(css())
        .pipe(gulp.dest("dist/css/css"));
    done();
});

